let geolocation = new BMap.Geolocation();
	geolocation.getCurrentPosition(function(r){
		if(this.getStatus() == BMAP_STATUS_SUCCESS){
			getWeatherByGeo(r.point.lng, r.point.lat)
		}else{
			alert('failed'+this.getStatus());
		}        
	})
function getWeatherByGeo(lng, lat){
	$.ajax({
		url:"https:devapi.qweather.com/v7/weather/7d?",
		type:"get",
		dataType: "json",
		data:{
			location:`${lng},${lat}`,
			key:"cfdc793e6293423c8b3002f3baca6e41"
		},
		success:function(res){
			console.log(res);
			for(let i=0;i<5;i++){
				$('.content li').eq(i).children().eq(0).children().eq(1).html(res.daily[i].fxDate);
				$('.content li').eq(i).children().eq(1).children().attr('src','./images/'+res.daily[i].iconDay+'.png');
				$('.content li').eq(i).children().eq(2).children().html(res.daily[i].textDay);
				$('.content li').eq(i).children().eq(3).children().html(res.daily[i].tempMax+"°");
				$('.content li').eq(i).children().eq(4).children().html(res.daily[i].tempMin+"°");
				$('.content li').eq(i).children().eq(5).children().attr('src','./images/'+res.daily[i].iconNight+'.png');
				$('.content li').eq(i).children().eq(6).children().html(res.daily[i].textNight);
				$('.content li').eq(i).children().eq(7).children().html(res.daily[i].windScaleDay+"级");
				$('.content li').eq(i).children().eq(8).children().html(res.daily[i].windScaleNight+"级");
			}
			for(let j=2; j<5; j++){
				let a = new Date(res.daily[j].fxDate).getDay();
				switch(a){
					case 0:
						day = "星期天";
						break;
					case 1:
						day = "星期一";
						break;
					case 2:
						day = "星期二";
						break;
					case 3:
						day = "星期三";
						break;
					case 4:
						day = "星期四";
						break;
					case 5:
						day = "星期五";
						break;
					case 6:
						day = "星期六";
						break;
				}
				$('.content li').eq(j).children().eq(0).children().eq(0).html(day);
			}
		}
	})
}


			